﻿using System;
using Object = UnityEngine.Object;

namespace Framework
{
    public class Log
    {
        public static LogLevel LogLevel = LogLevel.Debug;
        
        public static void Debug(object msg, Object context = null)
        {
            if(LogLevel <= LogLevel.Debug)
                UnityEngine.Debug.Log(msg);
        }
        
        public static void Warning(object msg, Object context = null)
        {
            if(LogLevel <= LogLevel.Warning)
                UnityEngine.Debug.LogWarning(msg,context);
        }
        
        public static void Error(object msg, Object context = null)
        {
            if(LogLevel <= LogLevel.Error)
                UnityEngine.Debug.LogError(msg, context);
        }
        
        public static void Exception(Exception exception, Object context = null)
        {
            if(LogLevel <= LogLevel.Exception)
                UnityEngine.Debug.LogException(exception, context);
        }
        
        public static void Assertion(object msg, Object context = null)
        {
            if(LogLevel <= LogLevel.Assert)
                UnityEngine.Debug.LogAssertion(msg, context);
            
        }
    }

    public enum LogLevel
    {
        Debug,
        Warning,
        Exception,
        Error,
        Assert,
    }
}